
#ifdef FLASH_CODE_HEADER

static const uint32_t flash_code_GD32F30X_HD[73] = 
{
    0XE00ABE00,0X062D780D,0X24084068,0XD3000040,0X1E644058,0X1C49D1FA,0X2A001E52,0X4770D1F2,
    0XF36F4939,0X44490012,0X48386008,0X60012100,0X60414937,0X60414937,0X074069C0,0X4836D408,
    0X5155F245,0X21066001,0XF6406041,0X608171FF,0X47702000,0X6901482D,0X0180F041,0X20006101,
    0X482A4770,0XF0416901,0X61010104,0XF0416901,0X61010140,0X21AAF64A,0XE0004A27,0X68C36011,
    0XD1FB07DB,0XF0216901,0X61010104,0X47702000,0X690A491E,0X0202F042,0X6148610A,0XF0406908,
    0X61080040,0X20AAF64A,0XE0004A1B,0X68CB6010,0XD1FB07DB,0XF0206908,0X61080002,0X47702000,
    0X1CC9B510,0X0103F021,0XE0194B10,0XF044691C,0X611C0401,0X60046814,0X07E468DC,0X691CD1FC,
    0X0401F024,0X68DC611C,0X0F14F014,0X68D8D005,0X0014F040,0X200160D8,0X1D00BD10,0X1F091D12,
    0XD1E32900,0XBD102000,0X00000004,0X40022000,0X45670123,0XCDEF89AB,0X40003000,0X00000000,
    0X00000000,
};

static const program_target_t flash_algo_GD32F30X_HD =
{
    0X20000021,  // Init
    0X20000055,  // UnInit
    0X20000063,  // EraseChip
    0X20000091,  // EraseSector
    0X200000C1,  // ProgramPage

    {
        0x20000001,  // BKPT : start of blob + 1
        0x20000C00,  // RSB  : address to access global/static data
        0x20001000,  // RSP  : stack pointer 
    },

    0x20000400,                      // mem buffer location
    0x20000000,                      // location to write prog_blob in target RAM
    sizeof(flash_code_GD32F30X_HD),       // prog_blob size
    flash_code_GD32F30X_HD,               // address of prog_blob 
    0x00000400,                      // ram_to_flash_bytes_to_be_written
};

#endif

#ifdef FLASH_CODE_TABLE
&flash_algo_GD32F30X_HD
#endif

